<%--

  Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, version 2.1, dated February 1999.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the latest version of the GNU Lesser General
  Public License as published by the Free Software Foundation;

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public License
  along with this program (LICENSE.txt); if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

--%>
<%@ page errorPage="/WEB-INF/jsp/error.jsp"
    contentType="text/html; charset=utf-8"
%>
<%@page import="org.lightframework.jamwiki.model.VirtualWiki"%>

<%@ include file="page-init.jsp" %>

<%@ include file="top.jsp" %>

<style type="text/css">
<!--
#contents-header{
	font-size:120%;
	color:#005288;
	font-weight:bold;
}
-->
</style>

<div id="wiki-page">
	<div id="top-panel">
	<%@ include file="user-menu.jsp"%>
	</div>
	<div id="wiki-content" style="margin-left:0">
	<div style="margin:0;margin-bottom:5px; padding:10px;background-color:#FFFFFF;height:350px;font-size:100%">
		<table width="100%" cellpadding="0" cellspacing="0" border="0" style="margin-bottom:20px">
		<tbody>
		<tr valign="top">
		<td width="53%">
			<h1 id="contents-header"><fmt:message key="dashboard.allwikis"><fmt:param value="${pageInfo.siteName}"/></fmt:message> </h1>
			<table width="100%" cellpadding="5" cellspacing="0" style="margin-top:5px;border-collapse: collapse;font-size:100%">
			<tbody>
				<c:forEach items="${wikis}" var="wiki">
				<tr height="40"
				    onmouseover="this.children[3].children[0].style.visibility=''" 
				    onmouseout="this.children[3].children[0].style.visibility='hidden'">
					<td valign="middle" nowrap style="font-size:120%;padding-left:10px;border-bottom:1px solid #AAAAAA;"
					    onmousover="this.style.cursor='pointer'">
						<a href="<c:url value="/${wiki.name}"/>"><c:out value="${wiki.name}"/></a>
					</td>
					<td style="border-bottom:1px solid #AAAAAA;">:</td>
					<td valign="middle" width="100%" style="border-bottom:1px solid #AAAAAA;cursor:pointer"
					    onclick="document.location='<c:url value="/${wiki.name}"/>'"> 
						<%=ServletUtilEx.viewTopic(((VirtualWiki)pageContext.findAttribute("wiki")).getName(),VirtualWiki.INTRODUCTION_TOPIC).getTopicContent()%>
					</td>
					<td valign="middle" nowrap style="border-bottom:1px solid #AAAAAA;">
						<span style="visibility:hidden">
						<%if(ServletUtilEx.isTopicEditable(VirtualWiki.SPECIAL_WIKI_NAME,VirtualWiki.INTRODUCTION_TOPIC)){ %>
							<a style="edit" title="<fmt:message key="tab.common.edit"/>" 
							   href="<%=LinkUtilEx.buildTopicEditUrl(((VirtualWiki)pageContext.findAttribute("wiki")).getName(),VirtualWiki.INTRODUCTION_TOPIC,true)%>"><img src="../images/edit_small.jpg" border="0"/></a>
						<%}%>	
						</span>
					</td>
				</tr>	
				</c:forEach>
			</tbody>
			</table>						
		</td>
		<td nowrap>&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td width="45%" 
			onmouseover="this.children[0].children[0].style.display=''" 
		    onmouseout="this.children[0].children[0].style.display='none'">
			<h1 id="contents-header">
				<span style="float:right;position:relative;font-size:9pt;font-weight:normal;margin-top:2px;margin-right:2px;display:none">
					<%if(ServletUtilEx.isTopicEditable(VirtualWiki.SPECIAL_WIKI_NAME,VirtualWiki.INTRODUCTION_TOPIC)){ %>				
					<a style="edit" title="<fmt:message key="tab.common.edit"/>" 
					   href="<%=LinkUtilEx.buildTopicEditUrl(VirtualWiki.SPECIAL_WIKI_NAME,VirtualWiki.INTRODUCTION_TOPIC,true)%>"><img src="../images/edit_small.jpg" border="0"/></a>
					<%}%>
				</span>
				<span>				
				<fmt:message key="dashboard.welcome"><fmt:param value="${pageInfo.siteName}"/></fmt:message>
				</span>
			</h1>
			<div style="height:200px;padding-top:10px;padding-left:0px">
				<%=ServletUtilEx.viewTopic(VirtualWiki.SPECIAL_WIKI_NAME,VirtualWiki.INTRODUCTION_TOPIC).getTopicContent()%>
			</div>							
		</td>
		</tr>
		</tbody>
		</table>
	</div>
	</div>
</div>

<%@ include file="wiki-footer.jsp"%>
<%@ include file="close-document.jsp"%>
